
class RPoint{
    var x:Int
    var y:Int
    
    init(x:Int, y:Int){
        self.x=x
        self.y=y
    }
}


struct SPoint{
    var x:Int
    var y:Int
    
    init(x:Int, y:Int){
        self.x=x
        self.y=y
    }
    
}

var rp=RPoint(x:10,y:20)
var sp=SPoint(x:10,y:20)

println(sizeofValue(rp))
println(sizeofValue(sp))
println(sizeofValue(rp.x))

func foo(){
    
    var rp1=RPoint(x:10,y:20)
    var rp2=rp1
    var sp1=SPoint(x:10,y:20)
    var sp2=sp1
    
    rp1.x++
    rp1.y++
    println("\nin foo() ...")
    println("\(rp1.x),\(rp1.y)")
    println("\(rp2.x),\(rp2.y)")
    
    println()
    sp1.x++
    sp1.y++
    println("\(sp1.x),\(sp1.y)")
    println("\(sp2.x),\(sp2.y)")
    
}


func foo1(){
    var rp1=RPoint(x:10,y:20)
    var sp1=SPoint(x:10,y:20)
    
    foo2(rp1,sp1)
    println("\nin foo1() ...")
    println("\(rp1.x),\(rp1.y)")
    println("\(sp1.x),\(sp1.y)")
    
    
}

func foo2(var rp2: RPoint, var sp2: SPoint){
    rp2.x++
    rp2.y++
    
    sp2.x++
    sp2.y++
    
    println("\nin foo2() ...")
    println("\(rp2.x),\(rp2.y)")
    println("\(sp2.x),\(sp2.y)")
}

foo()
foo1()









